window.onload = function(){
	var cookie = Cat.cookie;
	//Already login?
	if(cookie.get('username') === 'admin'){
		alert('sample url');
	}

	document.getElementById('login').onclick = function(){
		login();
	};
	function login(){
		var username = Cat.randomString(10);
		var password = Cat.randomString(10);

		var input_username = document.getElementById('username');
		var input_password = document.getElementById('password');

		if( username === input_username && password === input_password ){
			cookie.set('username','admin');
			alert('sample url');
		}else{
			alert('用户名或密码错误');
		}
	}

};
